/* Custom overrides for doggo web interface */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Navigation */
.terminal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent);
}

.logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent);
}

.terminal-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.terminal-menu li::marker {
    content: none;
}

/* Forms - Horizontal Layout */
.form-group {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group label {
    margin-bottom: 0;
}

.form-group input,
.form-group select {
    width: 100%;
    margin-top: 0;
}

/* Two column form layout for basic fields */
fieldset {
    display: block;
}

fieldset .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

fieldset .form-row .form-group {
    margin-bottom: 15px;
}

/* Full width fields */
fieldset .form-group.full-width {
    grid-column: 1 / -1;
}

input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    background: color-mix(in srgb, var(--foreground) 3%, transparent);
}

/* Advanced Options */
details {
    border: 2px solid var(--foreground);
    border-radius: calc(var(--radius) * 1.6);
    padding: 10px;
    margin-bottom: 20px;
}

summary {
    cursor: pointer;
    user-select: none;
    font-weight: bold;
    list-style: none;
    margin-bottom: 15px;
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: "▶ ";
    display: inline-block;
    transition: transform 0.2s;
}

details[open] summary::before {
    transform: rotate(90deg);
}

/* Two column layout for advanced options */
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.advanced-fieldset {
    margin: 0;
    padding: 15px;
}

.checkbox-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-top: 0;
}

.checkbox-row label input {
    margin-top: 0;
    width: auto;
}

/* Form Actions */
.form-actions {
    margin-top: 20px;
}

#message {
    color: var(--accent);
    margin-bottom: 15px;
    padding: 10px;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}

button.btn {
    margin-top: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: 2px solid var(--foreground);
    color: var(--foreground);
    padding: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: normal;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: var(--accent);
}

.tab-btn.active {
    background: var(--accent);
    color: var(--background);
    border-color: var(--accent);
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tables - Full Width */
table {
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    table-layout: auto;
}

thead th {
    text-align: left;
}

tbody td {
    word-break: break-word;
}

/* EDNS Grid */
#edns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
}

.edns-item {
    background: color-mix(in srgb, var(--foreground) 3%, transparent);
    padding: 12px;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.edns-label {
    font-size: 0.75rem;
    color: color-mix(in srgb, var(--foreground) 70%, transparent);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.05em;
}

.edns-value {
    color: var(--accent);
    font-weight: bold;
    word-break: break-all;
}

/* Empty messages */
.empty-msg {
    text-align: center;
    color: color-mix(in srgb, var(--foreground) 50%, transparent);
    padding: 30px 20px;
    font-style: italic;
}

/* Footer */
.footer-card {
    margin-top: 40px;
    text-align: center;
    padding: 20px;
    border: 2px solid var(--foreground);
    border-radius: calc(var(--radius) * 1.6);
}

.footer-card p {
    margin: 0;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 968px) {
    .advanced-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .terminal-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    fieldset .form-row {
        grid-template-columns: 1fr;
    }

    .form-group {
        grid-template-columns: 100px 1fr;
        gap: 10px;
    }

    .advanced-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tabs {
        flex-direction: column;
    }

    /* Stack tables on mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    tbody tr {
        margin-bottom: 15px;
        border: 2px solid var(--foreground);
        padding: 10px;
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid color-mix(in srgb, var(--foreground) 30%, transparent);
    }

    tbody td:last-child {
        border-bottom: none;
    }

    tbody td::before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: var(--accent);
    }

    #edns-grid {
        grid-template-columns: 1fr;
    }
}
